using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using Example.Model;

namespace Example.WebService
{
    /// <summary>
    /// Summary description for MyTestService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class MyTestService : System.Web.Services.WebService, ISimple, IComplex
    {
        #region ISimple Members

        [WebMethod]
        public string Jion(string a, string b, string c)
        {
            return a+b+c;
        }

        #endregion

        #region IComplex Members

        [WebMethod]
        public void Simple()
        {
            // do nothing
        }

        [WebMethod]
        public void OneParam(int i)
        {
            ;
        }

        [WebMethod]
        public void AnotherParam(Another i)
        {
            ;
        }

        [WebMethod]
        public int SimpleReturn()
        {
            return 10;
        }

        [WebMethod]
        public int OneParamReturn()
        {
            return 99;
        }

        [WebMethod]
        public string RefParam(ref int i, int j)
        {
            i = i + j;
            return i.ToString();
        }

        [WebMethod]
        public string OutParam(out int i)
        {
            i = 33;
            return i.ToString();
        }

        [WebMethod]
        public string RefAnother(ref Another a, out int i)
        {
            i = a.StringProperty.Length;
            a.StringProperty += " (length:" + i + ")";
            return a.StringProperty;
        }

        [WebMethod]
        public void OutAnother(out Another a)
        {
            a = new Another();
            a.StringProperty = "Created by server";
        }

        #endregion
    }
}
